Jetfire Wiki
Jazz CMS
Debug
Jetfire Core
Jetfire Language
Jetfire Web Part
Library
Release Notes
Roles
States
Web Service
Workflow Administration
Quick Search
»
Advanced Search »
Back
Empty Object
Modified on 2012/01/20 20:08
by
John
Categorized as
Jetfire Language
==Empty Object== An empty object is a 'read only' object that is automatically created by Jetfire as required on a per workflow class basis. It is a major component of Jetfire's [Void Safety] mechanisms. {TOC} ===Assigning Empty=== [Workflow|Workflows] are automatically assigned to the empty object. For example ((( {{ MyClass myObject; // is really MyClass myObject = MyClass.Empty(); }} ))) ===Testing for Empty=== Empty object can be tested using the follow contructs: ((( {{ if (myObject == MyClass.Empty()) ... }} ))) or ((( {{ if (isEmpty(myObject))... }} ))) Note: The method 'isEmpty' will also return true if the parameter is null. ===Modifying an Empty Object=== A 'Empty' object is a 'read only' object and can not be modified currently in Jetfire code. It can be modified by editing the XML representation of the empty object found in the [Server Nexus] persistent storage mechanism. ===[anchor|#Creating a custom empty object]Creating a Custom Empty Object (V1.3.5)=== A custom [empty object] can be created in a class by inserting a empty creation method called 'CreateEmpty()'. If this method is found the parser will execute this method a the end of parsing/code creation process, assigning the return value to the empty object for the class. Rules for 'CreateEmtpy' method (enforced by parser). * Must be static * Must have no parameters * Must have a return type of container class. * The name 'CreateEmpty' is reserved for this functionality. * Can not be over loaded. * Does not need to be public. * An empty object may not have [role] assigned. * Circular empty references are allowed (see the [example code|download for an example]). ** A double linked list would be an example of circular reference that is allowed. ((( {{ @"namespace Test {br} { {br} : public workflow Color {br} : { {br} :: string c; {br} :: public string Value {br} :: { {br} ::: get{return c;} {br} :: } :: // constructor :: public Color(string c) :: { ::: this.c = c; :: } {br} :: // Executes after the static constructor executes. {br} :: // The method 'CreateEmpty()' is called automatically at {br} :: // the end of parse/compilation process. {br} :: public static Color CreateEmpty() {br} :: { {br} ::: // make the empty color 'no color' {br} ::: Color color = new Color(""no color""); {br} ::: return color; {br} :: } {br} : } {br} } {br} }} ))) ===See Also=== * [Void Safety] * [Workflow] * [First Class Constructs]
Meta Keywords:
Meta Description:
Change Comment:
ScrewTurn Wiki
version 3.0.4.560. Some of the icons created by
FamFamFam
.